<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>服务通知指派</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="../../../css/mui.min.css">
		<link rel="stylesheet" href="../../../css/global.css">
		<link rel="stylesheet" href="../../../css/style.css">
		<style type="text/css">
			.inline-block {
				color: #5d5d5d;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 id="title" class="mui-title">服务通知指派</h1>
		</header>
		<div class="mui-content">
			<div class="details_con">
				<div class="clum">
					<span class="name">服务编号</span>
					<span class="txt" id="serviceNo"></span>
				</div>
				<div class="clum">
					<span class="name">提交时间</span>
					<span class="txt" id="createTime"></span>
				</div>
				<div class="clum">
					<span class="name">服务子类型</span>
					<span class="txt" id="serviceType"></span>
				</div>
				<div class="clum_arr">
					<span class="name_arr">客户名称</span>
					<span class="txt_arr" id="customerName"></span>
				</div>
				<div class="clum">
					<span class="name">客户类型</span>
					<span class="txt" id="enginnerType"></span>
				</div>
				<div class="clum">
					<span class="name">期望服务时间</span>
					<span class="txt" id="hopeBusinessHours"></span>
				</div>
				<div class="clum">
					<span class="name">Account FSE</span>
					<span class="txt" id="accoutfseName"></span>
				</div>
				<div class="my-content-cell">
					<div class="inline-block" id="khxxxx">
						<em>客户详细信息</em>
						<span class="mui-icon mui-icon-arrowright arrow-right-position"></span>
					</div>
				</div>
				<div class="my-content-cell">
					<div class="inline-block" id="yqxx">
						<em>仪器详细信息</em>
						<span class="mui-icon mui-icon-arrowright arrow-right-position"></span>
					</div>
				</div>
				<div class="my-content-cell">
					<div class="inline-block" id="htxx">
						<em>合同详细信息</em>
						<span class="mui-icon mui-icon-arrowright arrow-right-position"></span>
					</div>
				</div>
				<div class="my-content-cell">
					<div class="inline-block" id="fwtzxx">
						<em>服务通知详细信息</em>
						<span class="mui-icon mui-icon-arrowright arrow-right-position"></span>
					</div>
				</div>
				<div class="my-content-cell">
					<div class="inline-block" id="tjsybjxx">
						<em>推荐使用备件详细信息</em>
						<span class="mui-icon mui-icon-arrowright arrow-right-position"></span>
					</div>
				</div>
			</div>
			<div class="btn_box">
				
				<span class="fl" id="qingqiuzhiyuan">请求支援</span>
				<span class="fr red" id="zhipaiFSE">指派FSE</span>
			</div>
			<div style="height: 50px;"></div>
		</div>

		<!-- js代码 start -->

		<!-- 基础js start -->
		<script src="../../../js/mui.min.js"></script>
		<script src="../../../js/utils/h.js"></script>
		<script src="../../../js/constant.js"></script>
		<script src="../../../js/common.js"></script>
		<script src="../../../js/utils/base64.js"></script>
		<script src="../../../js/utils/md5.js"></script>
		<script src="../../../js/utils/sortMap.js"></script>
		<script src="../../../js/utils/http.js"></script>
		<script src="../../../js/app.js"></script>
		<!-- 基础js end -->

		<script type="text/javascript" charset="utf-8">
			(function($, doc) {
				$.init();

				var ServiceNoticeId
				var serviceNo
			
				// 仪器详情用带过去
				var trainQuota
				var installationDate
				var cfda

				// 服务通知详细信息用
				var serviceType
				var isWarranty
				var troubleDescription
				var remark

				$.plusReady(function() {
					// 从上一个页面取值
					var self = plus.webview.currentWebview();
					// 获取上一个页面传过来的参数并显示到页面
					ServiceNoticeId = self.ServiceNoticeId;
					serviceNo = self.serviceNo;

					console.log("ServiceNoticeId:" + ServiceNoticeId + "	serviceNo:" + serviceNo)

					// 获取详情的方法
					getDetails();

					// 客户详细信息
					h("#khxxxx").tap(function() {
						app.jumpTo("/view/service/assign/customerDetails.html", "view/service/assign/customerDetails.html", {
							ServiceNoticeId: ServiceNoticeId,
							serviceNo: serviceNo
						});
					})

					// 仪器详细信息
					h("#yqxx").tap(function() {
						app.jumpTo("/view/service/assign/instrumentDetails.html", "view/service/assign/instrumentDetails.html", {
							ServiceNoticeId: ServiceNoticeId,
							serviceNo: serviceNo,
							trainQuota: trainQuota,
							installationDate: installationDate,
							cfda: cfda
						});
					})

					// 合同详细信息
					h("#htxx").tap(function() {
						// app.toast("暂未开放");
						app.jumpTo("/view/service/accept/contractDetails.html", "view/service/accept/contractDetails.html",{
							serviceNo: serviceNo,
						});
					})

					// 服务通知详细信息
					h("#fwtzxx").tap(function() {
						app.jumpTo("/view/service/assign/noticeDetails.html", "view/service/assign/noticeDetails.html", {
							ServiceNoticeId: ServiceNoticeId,
							serviceNo: serviceNo,
							serviceType: serviceType,
							isWarranty: isWarranty,
							troubleDescription: troubleDescription,
							remark: remark
						});
					})

					// 推荐使用备件详细信息
					h("#tjsybjxx").tap(function() {
						app.jumpTo("/view/service/assign/partDetails.html", "view/service/assign/partDetails.html", {
							ServiceNoticeId: ServiceNoticeId,
							serviceNo: serviceNo
						});
					})

				});

				// 获取详情的方法
				function getDetails() {
					app.showWaiting('加载中...')
					ajaxGet(BASE_URL + "cc/notice/getDaiZhiPaiNoticeDetail", {
						"ServiceNoticeId": ServiceNoticeId
					}, function(data) {
						app.closeWaiting()
						console.log(JSON.stringify(data))
						if (data.code == 200) {
							if (data.data != "") {
								h("#serviceNo").html(data.data.serviceNo);
								h("#createTime").html(data.data.createTime);
								h("#serviceType").html(data.data.subServiceType);
								h("#customerName").html(data.data.customerName);

								if (data.data.enginnerType == undefined || data.data.enginnerType == "") {
									h("#enginnerType").html("无");
								} else {
									h("#enginnerType").html(data.data.enginnerType);
								}
								if (data.data.hopeBusinessHours == undefined || data.data.hopeBusinessHours == "") {
									h("#hopeBusinessHours").html("无");
								} else {
									h("#hopeBusinessHours").html(data.data.hopeBusinessHours);
								}
								if (data.data.accoutfseName == undefined || data.data.accoutfseName == "") {
									h("#accoutfseName").html("无");
								} else {
									h("#accoutfseName").html(data.data.accoutfseName);
								}

								// 仪器详细信息页面用
								if (data.data.trainQuota == undefined || data.data.trainQuota == "") {
									trainQuota = "";
								} else {
									trainQuota = data.data.trainQuota;
								}
								if (data.data.installationDate == undefined || data.data.installationDate == "") {
									installationDate = "";
								} else {
									installationDate = data.data.installationDate;
								}
								if (data.data.cfda == undefined || data.data.cfda == "") {
									cfda = "";
								} else {
									cfda = data.data.cfda;
								}

								// 服务通知详细信息页面用
								if (data.data.serviceType == undefined || data.data.serviceType == "") {
									serviceType = "";
								} else {
									serviceType = data.data.serviceType;
								}
								if (data.data.isWarranty == undefined || data.data.isWarranty == "") {
									isWarranty = "";
								} else {
									isWarranty = data.data.isWarranty;
								}
								if (data.data.troubleDescription == undefined || data.data.troubleDescription == "") {
									troubleDescription = "";
								} else {
									troubleDescription = data.data.troubleDescription;
								}
								if (data.data.remark == undefined || data.data.remark == "") {
									remark = "";
								} else {
									remark = data.data.remark;
								}


							}

						}
					}, function(errorMsg) {
						console.log(JSON.stringify(errorMsg))
					});
				}

				// 指派FSE
				h("#zhipaiFSE").tap(function() {
					app.jumpTo("/view/service/assign/assignFSE.html", "view/service/assign/assignFSE.html", {
						ServiceNoticeId: ServiceNoticeId,
						serviceNo: serviceNo,
						isWarranty: isWarranty,
						serviceType: serviceType
					});
				})

				// 请求支援
				h("#qingqiuzhiyuan").tap(function() {
					app.jumpTo("/view/service/assign/requestSupport.html", "view/service/assign/requestSupport.html", {
						ServiceNoticeId: ServiceNoticeId,
						serviceNo: serviceNo
					});
				})

			}(mui, document));
		</script>
		<!-- js代码 end -->

	</body>

</html>
